package com.lxw.report.meta.query.dbpool;

import com.lxw.report.meta.enums.DbPoolEnum;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * 数据源连接池工厂
 *
 */
public class DataSourcePoolFactory {
    private static Logger logger = LoggerFactory.getLogger(DataSourcePoolFactory.class);
    public static DataSourcePoolWrapper create( DbPoolEnum dataSourceInfoEnum) {
        logger.info("begin create DataSourcePoolWrapper...");
        DataSourcePoolWrapper dataSourcePoolWrapper=null;
            switch (dataSourceInfoEnum){
                case Druid:
                    dataSourcePoolWrapper=new DruidDataSourcePool();
                    break;
                case HiKariCP:
                    dataSourcePoolWrapper=new HiKariCpDataSourcePool();
                    break;
                default:
                    dataSourcePoolWrapper=null;
                    break;
            }
            return dataSourcePoolWrapper;
    }
}
